# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-ahocorasick
_pkgname=pyahocorasick
pkgver=v2.2.0.r0.gbd4a6d8
pkgrel=1
epoch=1
pkgdesc='Python module implementing Aho-Corasick algorithm.'
arch=('x86_64' 'aarch64')
url='https://github.com/WojciechMula/pyahocorasick'
license=('BSD')
depends=('python')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/WojciechMula/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname

  python setup.py build_ext --inplace
}

package() {
  cd $_pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

